<template>
	<view class="my-article-container">
		<view class="" v-if="articleList.length">
			<ListCard v-if="articleList.length" v-for="item in articleList" :key="item_id" :item="item"></ListCard>
		</view>
		<view class="my-article-noData" v-else>
			您还没有发布过文章
		</view>
	</view>
</template>

<script>
	export default {
		onLoad() {
			this.getMyArticleList()
		},
		data() {
			return {
				articleList: []
			}
		},
		methods: {
			//获取我的文章列表
			async getMyArticleList() {
				const list = await this.$http.get_my_article({
					userId: this.userInfo._id
				})
				this.articleList = list
			}
		}
	}
</script>

<style lang="scss" scoped>
	.my-article-noData {
		width: 100%;
		height: 400rpx;
		text-align: center;
		line-height: 400rpx;
		color: #888;
		font-size: 28rpx;
	}
</style>
